﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_PhysicalComponent class represents a low-level or basic component within a package. A physical element that is not a link, connector, or package is a descendent (or member) of this class. For example, the UART chipset on an internal modem card would be a subclass (if additional properties or associations are defined) or an instance of CIM_PhysicalComponent. 
    /// </summary>
    public class CIM_PhysicalComponent : CIM_PhysicalElement
    {
        private Nullable<Boolean> _HotSwappable;
        private Nullable<Boolean> _Removable;
        private Nullable<Boolean> _Replaceable;

        /// <summary>
        /// If TRUE, the package can be hot-swapped. A physical package can be hot-swapped if the element can be replaced by a physically different (but equivalent) one while the containing package is turned on. For example, a fan component may be designed to be hot-swapped. All components that can be hot-swapped are inherently removable and replaceable.
        /// </summary>
        public Nullable<Boolean> HotSwappable { get { return _HotSwappable; } }

        /// <summary>
        /// If TRUE, this element is designed to be taken in and out of the physical container in which it is normally found, without impairing the function of the overall packaging. A package is considered removable even if the power must be off to perform the removal. If the power can be on and the package removed, then the element is removable and can be hot-swapped. For example, an upgradeable processor chip is removable.
        /// </summary>
        public Nullable<Boolean> Removable { get { return _Removable; } }

        /// <summary>
        /// If TRUE, it is possible to replace the element with a physically different one. For example, some computer systems allow the main processor chip to be upgraded to one of a higher clock rating. In this case, the processor is said to be replaceable. All removable components are inherently replaceable.
        /// </summary>
        public Nullable<Boolean> Replaceable { get { return _Replaceable; } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_PhysicalComponent(ManagementBaseObject mbo)
            : base(mbo)
        {
            _HotSwappable = mbo.GetBoolValue("HotSwappable");
            _Removable = mbo.GetBoolValue("Removable");
            _Replaceable = mbo.GetBoolValue("Replaceable");
        }

    }
}
